package com.ruoyi.workflow.constants;

import io.swagger.models.auth.In;

/**
 * 审批意见的常量
 */
public class ApprovalTypeConstant {
    /**
     * 同意
     */
    public static final Integer APPROVE = 1;

    /**
     * 拒绝
     */
    public static final Integer REJECT = 2;

    /**
     * 修改后同意
     */
    public static final Integer MODIFY_APPROVE =3;

    /**
     * 退回
     */
    public static final Integer ROLLBACK =4;


    /**
     * 根据审批的数字状态获取字符串状态
     * @param approvalStatus
     * @return
     */
    public static String getApprovalStatus(Integer approvalStatus){
        if(approvalStatus == ApprovalTypeConstant.APPROVE){
            return "同意";
        }else if(approvalStatus == ApprovalTypeConstant.REJECT){
            return "拒绝";
        }else if(approvalStatus == ApprovalTypeConstant.MODIFY_APPROVE){
            return "修改后同意";
        }else if(approvalStatus == ApprovalTypeConstant.ROLLBACK){
            return "退回";
        }
        return "未知状态";
    }
}
